import React, { useState } from "react";
import { Navigate } from "react-router-dom";

export default function Home() {
  const [count, setCount] = useState(0);

  return (
    <div>
      <h3>我是Home的内容</h3>
      {count === 10 ? <Navigate to="/about" /> : count}
      <button onClick={() => setCount(count + 2)}>点击count+2</button>
    </div>
  );
}
